// import COSSDK from "cos-js-sdk-v5";
import TIM from 'tim-js-sdk';
import TIMUploadPlugin from 'tim-upload-plugin';
import { SDKAppID_IM } from '@/settings.js';

export default function initTim () {
  let tim = null;
  var SDKAppID = SDKAppID_IM;
  // 初始化 SDK 实例
  tim = TIM.create({ SDKAppID });
  window.setLogLevel = tim.setLogLevel;

  // 无日志级别
  tim.setLogLevel(3);
  tim.registerPlugin({ 'tim-upload-plugin': TIMUploadPlugin });

  // 注册 cos
  // tim.registerPlugin({ "cos-js-sdk": COSSDK });
  // static cos-js-sdk-v4.js
  return tim;
}
